﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DisplayBoardInfo.Server.Forms.CustomComponents.EntityList
{
    public static class ListModelFactory
    {
        public static ListModel Create(IEnumerable<Entities.Entity> entities)
        {
            if (entities.First().GetType() == Type.GetType("DisplayBoardInfo.Server.Entities.User")) return new UsersListModel((IEnumerable<Entities.User>)entities);
            else throw new NotSupportedException(entities.GetType().FullName + " nie są wspierane");
        }
    }
}
